/**
 * desc: 用户相关接口
 */

import request from '../../utils/request'

// 登录
const login = (data) => {
  return request({
    url: '/cms/user/login',
    method: 'POST',
    data
  })
}

// 更新用户
const updateUserInfo = (data) => {
  return request({
    url: '/cms/user',
    method: 'POST',
    data
  })
}

// 用户信息
const getUserInfo = () => {
  return request({
    url: '/cms/user/information',
    method: 'GET'
  })
}

//更新用户信息
const updateUser = (data) => {
  return request({
    url: '/cms/user',
    method: 'PUT',
    data
  })
}
//修改密码
const updatePWD = (data) => {
  return request({
    url: '/cms/user/change_password',
    method: 'PUT',
    data
  })
}

module.exports = {
  login,
  updateUserInfo,
  getUserInfo,
  updateUser,
  updatePWD
}